/*************************************************************
 * Title: 
 * Description: 
 * Author: Snow Huang
 * Email: Shaobin.Software@gmail.com Shaobin_Software@163.com
 * CreateTime: 2010-7-6 下午08:36:30
 * Copyright © 落羽社区 All right reserved
 ************************************************************/
package snow.biz.system.model;

import java.util.Date;

import org.apache.commons.lang.ObjectUtils;

import snow.core.domain.Person;

/**
 * 
 */
public class User extends Person {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4926135168618821866L;

	private Integer userId; // 用户ID

	private String username; // 用户名
	private String password; // 用户密码

	private Date registerTime; // 注册时间

	User() {
	}

	/**
	 * @param obj
	 * @return
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj instanceof User) {
			User user = (User) obj;
			return ObjectUtils.equals(getUsername(), user.getUsername());
		}
		return false;
	}

	/**
	 * @return the password
	 */
	public String getPassword() {
		return password;
	}

	/**
	 * @return the registerTime
	 */
	public Date getRegisterTime() {
		return registerTime;
	}

	/**
	 * @return the userId
	 */
	public Integer getUserId() {
		return userId;
	}

	/**
	 * @return the username
	 */
	public String getUsername() {
		return username;
	}

	/**
	 * @return
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		return ObjectUtils.hashCode(getUsername());
	}

	/**
	 * @param password
	 *            the password to set
	 */
	public User setPassword(String password) {
		this.password = password;
		return this;
	}

	/**
	 * @param registerTime
	 *            the registerTime to set
	 */
	User setRegisterTime(Date registerTime) {
		this.registerTime = registerTime;
		return this;
	}

	/**
	 * @param username
	 *            the username to set
	 */
	User setUsername(String username) {
		this.username = username;
		return this;
	}

}
